﻿@{
    ViewBag.Title = "Transfer";
}
@using IBS.Model
@model  Transfer 
<h2>
    Transfer</h2>
@if (!ViewData.ModelState.IsValid)
{
    <div>
        @Html.ValidationSummary(false)
    </div>
}
else
{
    <div>
        Transfered</div>
    <table>
        <tr>
            <td>
                Bill Number:
            </td>
            <td>@Model.Id
            </td>
        </tr>
        @if (@Model.FromCard != null)
        {
            <tr>
                <td>From Card Number:</td>
                <td>@Model.FromCard.Number</td>
            </tr>
        }
        @if (@Model.ToCard != null)
        {
            <tr>
                <td>To Card Number:</td>
                <td>@Model.ToCard.Number</td>
            </tr>
        }
        <tr>
            <td>Amount:</td>
            <td>@Model.FromAccountAmount.ToString("0.####")
            </td>
        </tr>
        <tr>
            <td>Currency:</td>
            <td>@((Model.FromCard ?? Model.ToCard).Account.Currency.ISO)
            </td>
        </tr>
    </table>
    
    <span>@Html.ActionLink("Back", "Index", new {id = (Model.FromCard ?? Model.ToCard).Account.ClientId})</span>
    <span>@Html.ActionLink("Get Bill", "GetBill", new { transferId = Model.Id }, null)</span>
}
